package com.ruoyi.web.domain.vo;

import com.fasterxml.jackson.annotation.JsonInclude;

/**
 * 微信支付响应实体
 * 
 * @author ruoyi
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class WxPayResponse {
    
    /** 响应码 */
    private Integer code;
    
    /** 响应消息 */
    private String message;
    
    /** 响应数据 */
    private Object data;
    
    public WxPayResponse() {
    }
    
    public WxPayResponse(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
    
    public WxPayResponse(Integer code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }
    
    /**
     * 成功响应
     */
    public static WxPayResponse success() {
        return new WxPayResponse(200, "操作成功");
    }
    
    /**
     * 成功响应带数据
     */
    public static WxPayResponse success(Object data) {
        return new WxPayResponse(200, "操作成功", data);
    }
    
    /**
     * 成功响应带消息和数据
     */
    public static WxPayResponse success(String message, Object data) {
        return new WxPayResponse(200, message, data);
    }
    
    /**
     * 失败响应
     */
    public static WxPayResponse error() {
        return new WxPayResponse(500, "操作失败");
    }
    
    /**
     * 失败响应带消息
     */
    public static WxPayResponse error(String message) {
        return new WxPayResponse(500, message);
    }
    
    /**
     * 失败响应带码和消息
     */
    public static WxPayResponse error(Integer code, String message) {
        return new WxPayResponse(code, message);
    }
    
    public Integer getCode() {
        return code;
    }
    
    public void setCode(Integer code) {
        this.code = code;
    }
    
    public String getMessage() {
        return message;
    }
    
    public void setMessage(String message) {
        this.message = message;
    }
    
    public Object getData() {
        return data;
    }
    
    public void setData(Object data) {
        this.data = data;
    }
}